<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>九九乘法口诀表</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        h1 {
            text-align: center;
            color: #333;
        }
        .multiplication-table {
            width: 100%;
            max-width: 600px;
            margin: 0 auto;
            border-collapse: collapse;
        }
        .multiplication-table td {
            padding: 10px;
            text-align: center;
            border: 1px solid #ddd;
        }
        .odd-row {
            background-color: #f5f5f5;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <h1>九九乘法口诀表</h1>
    <table class="multiplication-table">
        <tbody>
            <script>
                for (let i = 1; i <= 9; i++) {
                    document.write('<tr' + (i % 2 !== 0 ? ' class="odd-row"' : '') + '>');
                    for (let j = 1; j <= i; j++) {
                        document.write('<td>' + j + '×' + i + '=' + (i * j) + '</td>');
                    }
                    // 填充空白单元格以保持表格整齐
                    for (let k = i + 1; k <= 9; k++) {
                        document.write('<td></td>');
                    }
                    document.write('</tr>');
                }
            </script>
        </tbody>
    </table>
</body>
</html>